﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Workflow.ComponentModel;
using System.Workflow.Activities;
using System.Workflow.ComponentModel.Serialization;
using YakShaver.Contract;
namespace YakShaver
{
    /// <summary>
    /// Interface for working with Windows Workflow.  Service provides functions for provider to
    /// analyze the work item, notify users, and finally be notified to officially create a work item
    /// in their repositroy
    /// </summary>
    [ExternalDataExchange]
	public interface IWorkItemProviderService
	{
        /// <summary>
        /// Fired when external source (user) has modified the work item details to satisfy conditions to move further along the workflow.  
        /// </summary>
        event EventHandler<WorkItemModifiedEventArgs> WorkItemModifedEvent;

        /// <summary>
        /// Provider (Like CodePlex provider) takes work item data and maps in criteria (such as component, issue, and if it needs intervention)
        /// </summary>
        /// <param name="workItemData">Instance of IWorkItemDataContract passed from the WCF (or other) service</param>
        /// <returns>Instance of YakShaverWorkItem</returns>
        //YakShaverWorkItem AnalyzeSubmittedWorkItem(ref IWorkItemDataContract workItemData);
        /// <summary>
        /// Provider notifies users (or whatever) that some sort of action needs to be taken.  No return type as it waits
        /// for a response on an event.
        /// </summary>
        /// <param name="nofityCount">Number of times this event has occured for this workflow instance</param>
        /// <param name="workItem">The YakShaverWorkItem for this workflow instance</param>
        /// <returns>bool of whether or not it was successful</returns>
     //   bool NotifyForIntervention(int nofityCount, YakShaverWorkItem workItem);
        /// <summary>
        /// Notify the provider that all criteria have passed and to add the work item to it's own respository.  
        /// </summary>
        /// <param name="workItem">The YakShaverWorkItem for this workflow instance</param>
        void CreateWorkItem(YakShaverWorkItem workItem);
        void ModifyWorkItem(YakShaverWorkItem workItem, IWorkItemDataContract dataContract);

	}

    //[Serializable()]
    //public class WorkItemModifiedEventArgs : ExternalDataEventArgs
    //{
    //    public WorkItemModifiedEventArgs(Guid instanceId)
    //        : base(instanceId)
    //    {

    //    }
    //}

    //todo: turn this internal... and then say which classes can use it.
  
}
